<script setup>
import {useRoute} from "vue-router";
import {common_msg_ref} from "../common.js";

import {ref} from "vue";
import axios from "axios";

const itemsRef = ref([]);
const argRef = ref(0);

function addItemsRef(args) {
  itemsRef.value.push(args);
  itemsRef.value.sort();
}


// console.log(Number(12).toFixed(2));

const pattern = /match me/ig;
let regExpExecArray = pattern.exec("match mE asd");
let bse = "asd"
console.log(new RegExp("345asd").exec(`345${bse}`));


// axios.request({
//   url: domain + url,
//   methods: "post",
//   headers: {
//     "Content type": "application/json"
//   },
//   data: request
// }).then(function (data) {
//   console.log(data);
// }).catch(function (err) {
// })

</script>

<template>
  <div>
    route_test
    <div>来自共有组件的信息 {{ common_msg_ref }}</div>
  </div>

  <ul>
    <li>进行for循环测试 <br>
      <form @submit.prevent="addItemsRef(argRef)">
        <input v-model="argRef"></input>
      </form>
      {{ itemsRef }}
      <p v-for="each in itemsRef">
        {{ each }}
      </p>
    </li>


  </ul>

  <router-link to="/">BACK TO TITLE</router-link>
</template>

<style scoped>

</style>